import Vue from 'vue'
import Router from 'vue-router'
// const indexPage = r => require.ensure([], () => r(require('../view/index.vue')))
// const testPage = r => require.ensure([], () => r(require('../view/test.vue')))
import Index from '../view/index.vue'
Vue.use(Router)

var router = new Router({
  routes: [
    {
      path: '/',
      redirect: to => {
        return '/index'
      }
    },
    {
      path: '/index',
      name: 'index',
      components: {
        view: Index
      }
    },
    // {
    //   path: '/test',
    //   name: 'test',
    //   components: {
    //     view: testPage
    //   }
    // },
  ]
})

export default router